# 客户端
# 倒包
import urllib.request       # 请求库
from urllib import parse        # 引入parse 进行编码


url = "http://127.0.0.1:5000/"      # 请求地址
p = "广东"
c = "深圳"
p = urllib.parse.quote(p)       # 字符编码
c = urllib.parse.quote(c)       # 字符编码
data = "provice="+p+"&city="+c      # 字符拼接
url = url+"?"+data       # URL 拼接
# print(url)       # 打印


resp = urllib.request.urlopen(url=url)      # 发起请求
data = resp.read()      # 读取数据
html = data.decode("utf-8")     # 编码方式
print(html)

